﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace HaveYouSeenMe.Controllers
{
    public class PetController : Controller
    {
        public ActionResult Display()
        {
            var name = (string)RouteData.Values["id"];
            //var model = PetManagement.GetByName(name);
            ViewResult model = null;

            if (model == null)
            {
                return RedirectToAction("NotFound");
            }

            return View(model);
        }

        public ActionResult NotFound()
        {
            return View();
        }

        public FileResult DownloadPetPicture()
        {
            var name = (string)RouteData.Values["id"];
            var picture = "/Content/Uploads/" + name + ".jpg";
            var contentType = "image/jpg";
            var fileName = name + ".jpg";
            //return File(picture, contentType, fileName);
            return File(picture, contentType);
        }

        public HttpStatusCodeResult UnauthorizedError()
        {
            return new HttpUnauthorizedResult("Custom Unauthorized Error");
        }

        public ActionResult NotFoundError()
        {
            return HttpNotFound("Nothing here...");
        }
    }
}
